#pragma once
#include "afxcmn.h"


// CDlgViewHistory dialog

class CDlgViewHistory : public CDialog
{
	DECLARE_DYNAMIC(CDlgViewHistory)

public:
	CDlgViewHistory(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgViewHistory();

// Dialog Data
	enum { IDD = IDD_VIEW_HISTORY };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	CTreeCtrl m_wndHistory;
	CStringArray m_arrHistory;
	LPITEMIDLIST FindFolder(LPCTSTR foldername, IShellFolder* pFolder);
	BOOL Initialize();
	void AddHistory(IShellFolder* pFolder,HTREEITEM root, int nImg=0, int nOImg=0, BOOL bNeedCmp=FALSE);
	BOOL StrRetToStr(STRRET StrRet, LPTSTR* str, LPITEMIDLIST pidl);
	BOOL Update(int nLevel);
	IMalloc * m_pMalloc;
	BOOL ResolveHistory(IShellFolder* pFolder, LPCITEMIDLIST pidl, LPTSTR* lpszURL);

	afx_msg void OnTvnSelchangedTreeHistory(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMClickTreeHistory(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnNcDestroy();
	virtual BOOL OnInitDialog();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
};
